#pragma once


#include <string>
#include <unordered_map>
#include <memory>
#include <functional>

#include "rtda/frame.h"


namespace jvm {
    namespace native {
        
        using MethodFunc = std::function< void(std::shared_ptr< rtda::Frame > ) >;

        void EmptyNativeMethod(std::shared_ptr<rtda::Frame>);

        class Registry {
        private:
            //static std::unordered_map<std::string, std::shared_ptr<NativeMethod>> g_registry;
            static std::unordered_map<std::string, MethodFunc> g_registry;


            //static EmptyNativeMethod g_emptyNativeMethod;
            static MethodFunc g_pEmptyNativeMethod;

        public:
            static void registerMethod(
                const std::string& className,
                const std::string& methodName,
                const std::string& methodDescriptor,
                MethodFunc method
            );

            static MethodFunc findNativeMethod(
                const std::string& className,
                const std::string& methodName,
                const std::string& methodDescriptor
            );
        };

    } // namespace native
} // namespace jvm